package com.normal.main.fragment

import android.os.Bundle
import android.view.View
import androidx.core.net.toUri
import androidx.navigation.NavDeepLinkRequest
import androidx.navigation.fragment.findNavController
import com.normal.main.R
import com.normal.main.databinding.FragmentMainBinding
import com.normal.main.databinding.FragmentMineBinding
import com.normal.zbase.impl.base.BaseFragment
import com.normal.zbase.impl.tools.extend.click
import com.normal.zbase.impl.tools.extend.logger

private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

class MineFragment : BaseFragment<FragmentMineBinding>() {
    private var param1: String? = null
    private var param2: String? = null
    override fun viewBinding(): FragmentMineBinding {
        return FragmentMineBinding.inflate(layoutInflater)
    }

    override fun initView(view: View, savedInstanceState: Bundle?) {
        super.initView(view, savedInstanceState)
        arguments?.let {
            param1 = it.getString(ARG_PARAM1)
            param2 = it.getString(ARG_PARAM2)
        }
        logger.info("param1=$param1,param2=$param2")
        viewBinding.btnAct.click {
            findNavController().navigate(R.id.action_thridFragment_to_MVVMBindActivity)
        }
    }

    companion object {
        @JvmStatic
        fun newInstance(param1: String, param2: String) =
            MineFragment().apply {
                arguments = Bundle().apply {
                    putString(ARG_PARAM1, param1)
                    putString(ARG_PARAM2, param2)
                }
            }
    }
}